package com.snowfield.lb47.lbconfig.domain;

import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.springframework.data.annotation.Transient;

/**
 * 代理服务器对象 config_frontproxy_server
 *
 * @author snowfield
 * @date 2024-04-08
 */
public class FrontProxyServer extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 标识ID
     */
    private Long id;

    /**
     * 代理标识ID
     */
    @Excel(name = "代理标识ID")
    private Long proxyId;

    /**
     * 服务器标识ID
     */
    @Excel(name = "服务器标识ID")
    private Long serverId;

    /**
     * 服务器名称
     */
    @Transient
    private String serverName;

    /**
     * 服务器Ip
     */
    @Transient
    private String serverIp;

    /**
     * 服务端口
     */
    @Excel(name = "服务端口")
    private Integer servicePort;

    /**
     * 健康检测端口
     */
    @Excel(name = "健康检测端口")
    private Integer checkPort;

    /**
     * 权重
     */
    @Excel(name = "权重")
    private Integer weight;

    /**
     * 检测时间间隔(ms)
     */
    @Excel(name = "检测时间间隔(ms)")
    private Integer inter;

    /**
     * 检测成功阀值
     */
    @Excel(name = "检测成功阀值")
    private Integer rise;

    /**
     * 检测失败阀值
     */
    @Excel(name = "检测失败阀值")
    private Integer fall;

    /**
     * 最大连接
     */
    @Excel(name = "最大连接")
    private Integer maxconn;

    /**
     * 服务器证书标识ID
     */
    @Excel(name = "服务器证书标识ID")
    private Long servercrtId;

    /**
     * 服务器证书名称
     */
    private String serverCrtName = "";

    public void setId(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setProxyId(Long proxyId) {
        this.proxyId = proxyId;
    }

    public Long getProxyId() {
        return proxyId;
    }

    public void setServerId(Long serverId) {
        this.serverId = serverId;
    }

    public Long getServerId() {
        return serverId;
    }

    public String getServerName() {
        return serverName;
    }

    public void setServerName(String serverName) {
        this.serverName = serverName;
    }

    public String getServerIp() {
        return serverIp;
    }

    public void setServerIp(String serverIp) {
        this.serverIp = serverIp;
    }

    public void setServicePort(Integer servicePort) {
        this.servicePort = servicePort;
    }

    public Integer getServicePort() {
        return servicePort;
    }

    public void setCheckPort(Integer checkPort) {
        this.checkPort = checkPort;
    }

    public Integer getCheckPort() {
        return checkPort;
    }

    public void setWeight(Integer weight) {
        this.weight = weight;
    }

    public Integer getWeight() {
        return weight;
    }

    public void setInter(Integer inter) {
        this.inter = inter;
    }

    public Integer getInter() {
        return inter;
    }

    public void setRise(Integer rise) {
        this.rise = rise;
    }

    public Integer getRise() {
        return rise;
    }

    public void setFall(Integer fall) {
        this.fall = fall;
    }

    public Integer getFall() {
        return fall;
    }

    public void setMaxconn(Integer maxconn) {
        this.maxconn = maxconn;
    }

    public Integer getMaxconn() {
        return maxconn;
    }

    public void setServercrtId(Long servercrtId) {
        this.servercrtId = servercrtId;
    }

    public Long getServercrtId() {
        return servercrtId;
    }

    public String getServerCrtName() {
        return serverCrtName;
    }

    public void setServerCrtName(String serverCrtName) {
        this.serverCrtName = serverCrtName;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("proxyId", getProxyId())
                .append("serverId", getServerId())
                .append("servicePort", getServicePort())
                .append("checkPort", getCheckPort())
                .append("weight", getWeight())
                .append("inter", getInter())
                .append("rise", getRise())
                .append("fall", getFall())
                .append("maxconn", getMaxconn())
                .append("servercrtId", getServercrtId())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .append("remark", getRemark())
                .toString();
    }
}
